<?php
class SendSMS{
public function envio ($host, $port, $username, $password, $phoneNoRecip, $msgText) {
    $fp = fsockopen($host, $port, $errno, $errstr);
    if (!$fp) {
        echo "errno: $errno \n";
        echo "errstr: $errstr\n";
        return $result;
    }
    fwrite($fp, "GET /PhoneNumber=" . rawurlencode($phoneNoRecip) . "&Text=" . rawurlencode($msgText) . " HTTP/1.0\n");
	echo $aux3;
    if ($username != "") {
       $auth = $username . ":" . $password;
       echo "auth: $auth\n";
       $auth = base64_encode($auth);
       echo "auth: $auth\n";
       fwrite($fp, "Authorization: Basic " . $auth . "\n");
    }
    fwrite($fp, "\n");  
    $res = ""; 
    while(!feof($fp)) {
        $res .= fread($fp,1);
    }
    fclose($fp);    
 
    return $res;
    }
}
?>